package com.huawei.service.impl;

import com.huawei.dao.JinebiandongMapper;
import com.huawei.dao.UserMapper;
import com.huawei.dao.User_siteMapper;
import com.huawei.entity.Ddkuaizhao;
import com.huawei.entity.Jinebiandong;
import com.huawei.service.JinebiandongService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * @ClassName JinebiandongImpl
 * @Description TODO
 * @Author 快乐的大胖
 * @Date 2021/11/29 20:06
 */
@Service
public class JinebiandongImpl  implements JinebiandongService {


    @Resource
    JinebiandongMapper jinebiandongMapper;
    @Resource
    UserMapper userMapper;
    @Resource
    User_siteMapper user_siteMapper;
    @Override
    public List<Jinebiandong> selectAll(Map<String, Object> pars) {
        List<Jinebiandong> list=jinebiandongMapper.selectAll(pars);
        for(Jinebiandong n:list){
            n.setUser1(userMapper.getId(n.getUser_id()));
        }
        for(Jinebiandong a:list){
            a.setUser_site1(user_siteMapper.getId(a.getUser_id()));
        }
        return list;
    }

    @Override
    public int selectCount(Map<String, Object> pars) {
        return jinebiandongMapper.selectCount(pars);
    }

    @Override
    public int add(Jinebiandong jinebiandong) {
        return jinebiandongMapper.add(jinebiandong);
    }

    @Override
    public int update(Jinebiandong jinebiandong) {
        return jinebiandongMapper.update(jinebiandong);
    }

    @Override
    public int delete(int jilu_id) {
        return jinebiandongMapper.delete(jilu_id);
    }
}
